package com.it.utils;

import java.util.List;

public class PageUtils<T> {
    private Integer curPage;
    private Integer pageSize;
    private Integer totalPages;
    private Integer totalCount;
    private List<T> data;

    public Integer getCurPage() {
        return curPage;
    }

    public void setCurPage(Integer curPage) {
        this.curPage = curPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPages() {
        return getTotalCount()%pageSize==0?getTotalCount()/pageSize:getTotalCount()/pageSize+1;

    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
